export const getAgentIdBoxTop = (videoWaterMarkImage, videoWaterMark, videoAgentId) => {
	let height = '';
	if (videoWaterMark.showVideoWaterMark) {
		if ((videoAgentId.position === 'nw' && videoWaterMark.position === 'nw') || (videoAgentId.position === 'n' && videoWaterMark.position === 'n') || (videoAgentId.position === 'ne' && videoWaterMark.position === 'ne')) {
			height = videoWaterMarkImage.height + 56;
		}
	}
	return `top:${height}px`;
};

export const getVideoBoxWithOne = (videoWaterMarkImage, videoAgentId, videoWaterMark) => {
	let height = window.innerHeight;
	let watermarkheight = videoWaterMarkImage ? videoWaterMarkImage.height : 0;
	if (videoAgentId.position.indexOf('n') !== -1) {
		if (videoWaterMark.position === videoAgentId.position && videoWaterMark.showVideoWaterMark) {
			return `position: relative;top:${height * 0.5 - 50 + 10 - watermarkheight}px`;
		} else {
			return `position: relative;top:${height * 0.5 - 40}px`;
		}
	} else {
		return '';
	}
};

export const getVideoBoxWithTwo = (videoAgentId, agentMembers) => {
	let height = window.innerHeight;
	if (videoAgentId.position.indexOf('s') !== -1 && agentMembers.length > 1) {
		return `position: relative;top:${height * 0.5 + 90 - 10}px`;
	} else {
		return '';
	}
};

export const getVideoWateMarkPosition = (videoWaterMark, videoAgentId) => {
	if (videoWaterMark.position === 'nw') {
		return 'nw';
	} else if (videoWaterMark.position === 'n') {
		return 'n';
	} else if (videoWaterMark.position === 'ne') {
		return 'ne';
	} else if (videoWaterMark.position === 'sw') {
		if (videoAgentId.showVideoAgentId && videoAgentId.position === 'sw') {
			return 'waterMark-agentId-sw';
		} else {
			return 'sw';
		}
	} else if (videoWaterMark.position === 's') {
		if (videoAgentId.showVideoAgentId && videoAgentId.position === 's') {
			return 'waterMark-agentId-s';
		} else {
			return 's';
		}
	} else if (videoWaterMark.position === 'se') {
		if (videoAgentId.showVideoAgentId && videoAgentId.position === 'se') {
			return 'waterMark-agentId-se';
		} else {
			return 'se';
		}
	}
	return '';
};

export const getVideoAgentIdPosition = (videoWaterMark, videoAgentId) => {
	if (videoAgentId.position === 'nw') {
		if (videoWaterMark.showVideoWaterMark && videoWaterMark.position === 'nw') {
			return 'agentId-waterMark-nw';
		} else {
			return 'nw';
		}
	} else if (videoAgentId.position === 'n') {
		if (videoWaterMark.showVideoWaterMark && videoWaterMark.position === 'n') {
			return 'agentId-waterMark-n';
		} else {
			return 'n';
		}
	} else if (videoAgentId.position === 'ne') {
		if (videoWaterMark.showVideoWaterMark && videoWaterMark.position === 'ne') {
			return 'agentId-waterMark-ne';
		} else {
			return 'ne';
		}
	} else if (videoAgentId.position === 'sw') {
		return 'sw';
	} else if (videoAgentId.position === 's') {
		return 's';
	} else if (videoAgentId.position === 'se') {
		return 'se';
	}
	return '';
};
